<?php $this->id = ( isset($this->id) ? $this->id : "" ); ?>
<div id="dialogBuscarContribuyentePredio<?php echo $this->id; ?>">
    <table class="ui-panelLayout-main">
        <tr><td style="vertical-align: top;">
                <table style="width: 100%;">
                    <tr>
                        <td>
                            <table>
                                <tr class="rowBuscarContribuyente<?php echo $this->id; ?>">
                                    <td width="20">&nbsp;</td>
                                    <td width="100">C&oacute;digo:</td>
                                    <td width="10">&nbsp;</td>
                                    <td width="230">Apellidos y Nombre:</td>
                                    <td width="10">&nbsp;</td>
                                    <td width="230">&nbsp;</td>
                                    <td width="10">&nbsp;</td>
                                    <td width="230" colspan="5">Nro. Documento:</td>
                                    <td width="20">&nbsp;</td>
                                </tr>
                                <tr class="rowBuscarContribuyente<?php echo $this->id; ?>" id="panelBuscarContribuyente<?php echo $this->id; ?>">
                                    <td>&nbsp;</td>
                                    <td><input class="ui-text" id="c_codigocontrib<?php echo $this->id; ?>" maxlength="10" style="width:90px" /></td>
                                    <td>&nbsp;</td>
                                    <td colspan="3"><input class="ui-text pnl<?php echo $this->id; ?>" id="c_nombrecontrib<?php echo $this->id; ?>" style="width:100%" /></td>
                                    <td>&nbsp;</td>
                                    <td colspan="5"><input class="ui-text pnl<?php echo $this->id; ?>" id="c_apepatcontrib<?php echo $this->id; ?>" style="width:50%" /></td>
                                    <td>&nbsp;</td>
                                </tr>
                                <tr>
                                    <td colspan="13" height="8px"></td>
                                </tr>
                                <tr class="rowBuscarPredio<?php echo $this->id; ?>">
                                    <td width="20">&nbsp;</td>
                                    <td width="100">C&oacute;digo Predial:</td>
                                    <td width="10"></td>
                                    <td width="230">Centro Poblado:</td>
                                    <td width="10">&nbsp;</td>
                                    <td width="230">Via:</td>
                                    <td width="10">&nbsp;</td>
                                    <td width="50">Nro:</td>
                                    <td width="10">&nbsp;</td>
                                    <td width="50">Mza:</td>
                                    <td width="10">&nbsp;</td>
                                    <td width="50">Lote:</td>
                                    <td>&nbsp;</td>
                                </tr>
                                <tr class="rowBuscarPredio<?php echo $this->id; ?>" id="panelBuscarPredio<?php echo $this->id; ?>">
                                    <td>&nbsp;</td>
                                    <td><input class="ui-text" id="c_predial<?php echo $this->id; ?>" maxlength="10" style="width:90px;" /></td>
                                    <td></td>
                                    <td colspan="3"><input class="ui-text pnl<?php echo $this->id; ?>" id="c_viacontrib<?php echo $this->id; ?>" style="width:100%" /></td>
                                    <td>&nbsp;</td>
                                    <td width="50"><input class="ui-text pnl<?php echo $this->id; ?>" id="c_nroviacontrib<?php echo $this->id; ?>" style="width:100%" /></td>
                                    <td width="10">&nbsp;</td>
                                    <td width="50"><input class="ui-text pnl<?php echo $this->id; ?>" id="c_mzacontrib<?php echo $this->id; ?>" style="width:100%" /></td>
                                    <td width="10">&nbsp;</td>
                                    <td width="50"><input class="ui-text pnl<?php echo $this->id; ?>" id="c_lotecontrib<?php echo $this->id; ?>" style="width:100%" /></td>
                                    <td>&nbsp;</td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <button id="btnbuscar<?php echo $this->id; ?>" name="btnbuscar">Buscar</button>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2">
                            <br/>
                            <div id="panelResult<?php echo $this->id; ?>">
                                <table id="tblResult<?php echo $this->id; ?>"></table>
                                <div id="ptblResult<?php echo $this->id; ?>"></div>
                                <input type="hidden" id="ctblResult" name="ctblResult<?php echo $this->id; ?>" value="" />
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
<div id="dialogMensaje<?php echo $this->id; ?>">
    <table>
        <tr>
            <td>No existen registros con los criterios de busqueda ingresados.</td>
        </tr>
        <tr><td>&nbsp;</td><tr>
        <tr>
            <td align="right">
                <button id="btnBuscarNuevoContribuyente<?php echo $this->id; ?>">Nuevo Contribuyente</button>
                <button id="btnBuscarNuevoPredio<?php echo $this->id; ?>">Nuevo Predio</button>
                <button id="btnBuscarAceptar<?php echo $this->id; ?>">Aceptar</button>
            </td>
        </tr>
    </table>
</div>
<style>
    .ui-autocomplete {
        max-height: 218px;
        overflow-y: auto;
        overflow-x: hidden; /* prevent horizontal scrollbar */
        padding-right: 8px; /* add padding to account for vertical scrollbar */
    }

    /* IE 6 doesn't support max-height we use height instead, but this forces the menu to always be this tall */
    * html .ui-autocomplete {
        height: 218px;
    }
</style>
<script type="text/javascript">
    var jsonVias = <?php echo json_encode($this->mviascp); ?>, ccodvia = '';
    $("#c_viacontrib<?php echo $this->id; ?>").autocompleteCategory({
        delay: 0,
        source: jsonVias,
        minLength: 4,
        select: function(event, ui) {
            ccodvia = ui.item.ccodvia;
        },
        change: function(event, ui) {
            if (ui.item) {
                ccodvia = ui.item.ccodvia;
            } else {
                if ($(this).val().length > 0) {
                    openDialogWarning("El valor ingresado no esta en la lista de elementos.", 380, 150);
                }
            }
        }
    });
</script>
